﻿<UserControl x:Class="Giraffe.Client.MainWindowModule.ClientsPanel.MessengerStatusControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    >
    <UserControl.Resources>
        <Style x:Key="loginButtonStyle" BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type Button}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=IsLogin}" Value="False">
                    <Setter Property="Content" Value="Connect"/>
                    <Setter Property="Command" Value="{Binding Path=LoginCommand}"/>
                    <Setter Property="Background" Value="Red"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=IsLogin}" Value="True">
                    <Setter Property="Content" Value="Disconnect"/>
                    <Setter Property="Command" Value="{Binding Path=LogoutCommand}"/>
                    <Setter Property="Background" Value="Green"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>

    <Button Style="{StaticResource loginButtonStyle}"/>
</UserControl>
